﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using WarehouseManager.Core;
using WarehouseManager.Model;

namespace WarehouseManager.DataAccess
{
    class CTPhieuxuatAccess
    {
        dbConnection dbCon = new dbConnection();
        public CTPhieuxuatAccess() { }
        public DataTable laytoanboCTPhieuxuat() {
            return dbCon.executeSelectProcedureQueryNonParameter("proc_selectCTPhieuXuat");
        }
        public void themCTPhieuxuat(CTPhieuxuat ctpx)
        {
            SqlParameter[] listParams = new SqlParameter[3];
            SqlParameter maPX = new SqlParameter("@maPX", SqlDbType.VarChar, 10);
            maPX.Value = ctpx.maPX1;
            SqlParameter maHH = new SqlParameter("@maHH", SqlDbType.VarChar, 10);
            maHH.Value = ctpx.maHH1;
            listParams[0] = maPX;
            listParams[1] = maHH;
            listParams[2] = new SqlParameter("@soLuong", ctpx.soLuong1);
            dbCon.executeInsertProcedureQuery("proc_insertCTPhieuXuat", listParams);
        }
    }
}
